<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>修改logo</title>
	<link rel="stylesheet" href="bootstrap.min.css">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
      <style>
       #box img{
          width: 100px;
          height: 100px;
       }
    </style>
</head>
<body>
	<div class="container">
		 <h1>修改logo</h1>
		 <hr>
		 	<form action="https://shenyuxf.top/xglogo" 
			 method="POST" 
			 enctype="multipart/form-data">

			<div class="form-group">
                <label>请修改logo</label>
                <input required type="file" onchange='readImage(this,"#box")' name="image">
                <div id="box">
                <br>
                <img src="https://shenyuxf.top/1.jpg" alt="" id="img">
                </div>
            </div>
            <button type="submit" class="btn btn-success">确认修改</button>
            <a href="index.html" type="submit" class="btn btn-default ">返回</a>
            
			
			</form>

	</div>


	<script>
		   function readImage(fileObj,box,max) {
        // if(max&&fileObj.files.length>max){
        //     fileObj.value='';
        //     alert('文件数量超过上限,请重新选取')
        // }
        document.querySelector(box).innerHTML='';
        var i=0;
        // console.log(box)
        // console.log(fileObj.files)
        var frObj = new FileReader();

        frObj.onload = function() {
            var img = document.createElement("img");
            img.src = frObj.result;
            document.querySelector(box).appendChild(img);
            // if(i<fileObj.files.length){
            //     i++;
            //     frObj.readAsDataURL(fileObj.files[i]);
            // }
        }
        frObj.readAsDataURL(fileObj.files[i]);
    }


	</script>
</body>
</html>